﻿using TriplesProblems;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace TripleTests
{
    [TestClass()]
    public class TripleExtensionsTest
    {
        [TestMethod()]
        public void AsStringTest()
        {
            Triple[] tripleArray = { new Triple(1,2,3), new Triple(3,2,-1), new Triple(-2,-0,-99)};
            string expectedString = "{(1, 2, 3);(3, 2, -1);(-2, 0, -99)}";
            string actualString = tripleArray.AsString();
            Assert.AreEqual(expectedString, actualString);
        }

        [TestMethod()]
        [ExpectedException(typeof(NullReferenceException))]
        public void AsStringNullReferenceTest()
        {
            Triple[] tripleArray = null;
            string actualString = tripleArray.AsString();
        }
    }
}
